package com.power.using.mydaggerp.contract.movie;

import com.power.using.mydaggerp.base.BasePresenter;
import com.power.using.mydaggerp.base.IBaseActivity;
import com.power.using.mydaggerp.base.IBaseModel;
import com.power.using.mydaggerp.model.bean.douban.movie.MovieDetailBean;
import com.power.using.mydaggerp.model.bean.douban.movie.child.PersonBean;
import com.power.using.mydaggerp.model.bean.douban.movie.child.SubjectsBean;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/17.
 * Time: 2019/10/17  9:12
 */
public interface MovieDetailContract {

    abstract class MovieDetailPresenter extends BasePresenter<IMOvieDetailModel,IMovieDetailView>{

        /**
         * 加载电影详情
         *
         * @param id 电影id
         */
        public abstract void  loadMovieDetail(String id);

        /**
         * item点击事件
         *
         * @param position  position
         * @param item      item
         */
        public abstract void onItemClick(int position, PersonBean item);

        /**
         * header点击事件
         * @param bean bean
         */
        public abstract void onHeaderClick(SubjectsBean bean);

    }

    interface IMOvieDetailModel extends IBaseModel{

        /**
         * 获取电影详情
         * @param id 电影id
         * @return 电影详情
         */
        Observable<MovieDetailBean> getMovieDetail(String id);
    }



    interface IMovieDetailView extends IBaseActivity {

        /**
         * 显示电影详情
         *
         * @param bean 电影详情bean
         */
        void showMovieDetail(MovieDetailBean bean);

        /**
         * 显示网络错误
         */
        void showNetworkError();
    }
}
